<template>
  <tbody>
    <tr v-for="(item, index) in goodList" :key="index">
      <td>
        <input type="checkbox" v-model="item.checked" />
      </td>
      <td>{{ item.name }}</td>
      <td>{{ item.price }}</td>
      <td>
        <button :disabled="item.num===1" @click="item.num--">-</button>{{ item.num
        }}<button @click="item.num++">+</button>
      </td>
      <td>{{ item.price * item.num }}</td>
      <td><button @click="$emit('delBtn',index)">删除</button></td>
    </tr>
  </tbody>
</template>

<script>
export default {
  // 接收传过来的数组
  props: ['goodList'],
  methods: {
   
  },
}
</script>

<style></style>
